home *** CD-ROM | disk | FTP | other *** search
/ Belgian Amiga Club - ADF Collection / BS1 part 41.zip / BS1 part 41 / Abacus diskdrives IO.adf / CH9 / read-d.s < prev    next >
Text File  |  1978-06-28  |  4KB  |  27 lines

  1. Device         = 350Port           = 36           ;Offset for Drive 0RepPort        = 174SigTask        = 16Task           = 276FindName       = -276Track          = 20          ;Number of the Track to be read
  2.  
  3. ;Destination         = ????  ;Destination must be provided by the user.Destination    =$5000        ; for testing only
  4.  
  5.                move.l $4,a6             ;get ExecBase                lea Name,a1              ;set Pointer to Name                lea Device(a6),a0        ;Pointer to Device-List               jsr FindName(a6)         ;search for Trackdisk-Device                tst.l d0                 ;Device found ?               beq Error                ;No, Error
  6.                move.l Task(a6),a0       ;get Pointer to user Task               move.l d0,a6             ;Pointer to Task to A6
  7.  
  8.                move.l Port(a6),a3       ;get pointer to drive
  9.                                         ;Port (Drive 0)
  10.  
  11.                lea RepPort(a3),a1       ;Pointer to RepPort               move.l SigTask(a1),-(a7) ;save Pointer to Task               move.l a1,-(a7)          ;save Pointer to RepPort               move.l a0,SigTask(a1)    ;store user Task                bset #0,34(a3)           ;block Trackdisk-Task ; The actual load routine starts here               move.l #Track,d0         ;Track-Number to D0               move.w d0,74(a3)         ;store in Structure                move.l 78(a3),a2         ;Pointer to Data buffer               move.w d0,(a2)           ;store Track-Number                bclr #0,2(a2)            ;erase Bit 0               clr.b 66(a3)             ;erase Errornumber                jsr $fea99e              ;read Track                clr.l d0                 ;Value for Motor off               jsr $fea462              ;switch Motor off                move.b 3(a2),d0          ;first Block number to D0               cmp.b #$0b,d0            ;Number larger than 11               bcc Ende                 ;yes, Error
  12.  
  13.                move.b #$0b,d6           ;Sector Number               clr.l d0                 ;first Block = Null               sub.b 3(a2),d0               bpl l1               addi.b #$0b,d0           ;Address of the Blockl1:            mulu #$440,d0            ;calculate Null                lea 1664(a2),a4          ;Pointer to beginning of Data                adda.l d0,a4             ;Pointer to Block zero                lea Destination,a5       ;set Pointer to destination
  14.                clr.l d7                 ;start at Sector zero
  15.  
  16. l3:            lea 64(a4),a1            ;Pointer to Data block
  17.  
  18.                move.l a5,a0             ;Destination to A0
  19.  
  20.                move.l #$200,d0          ;Number of Data to be decoded
  21.                 jsr $feacb2              ;decode Data
  22.                 adda.l #$200,a5          ;increment Destination Pointer                sub.b #1,d6              ;decrement number of Blocks                beq Ende                 ;branch, when done                add.b #1,d7              ;increment Block number                cmp.b 3(a2),d7           ;continue at beginning of Buffer               bne l2                   ;no, continue normally                lea 1664(a2),a4          ;Pointer at beginning of Buffer                bra l3                   ;unconditional Jumpl2:            add.l #$440,a4           ;Pointer to next Block
  23.  
  24.                bra l3                   ;unconditional Jump
  25. ; End of the load routine. The modified pointers ; must be restored.Ende:          bclr #0,34(a3)            ;release Task again
  26.  
  27.                move.l (a7)+,a1          ;get Pointer to Task                move.l (a7)+,SigTask(a1) ;enter again in PortError:        rts                       ;Return jumpName:          dc.b 'trackdisk.device',0               END